package com.solomon.travel.common.front.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.solomon.travel.common.base.controller.BaseController;
import com.solomon.travel.common.model.ApiResponse;
import com.solomon.travel.common.model.Page;
import com.solomon.travel.common.po.Guide;
import com.solomon.travel.common.po.Hotel;
import com.solomon.travel.common.service.GuideService;
import com.solomon.travel.common.util.ConstantUtils;
import com.solomon.travel.common.util.PageUtils;

@RestController("frontGuideController")
@RequestMapping("/front/guide")
public class GuideController extends BaseController{
	
	@Resource
	private GuideService guideService;
	
	@RequestMapping("/list")
	public ApiResponse list(Integer pageIndex,Integer pageSize,Guide guide) {
		int guideCount = guideService.countBySerch(guide);
		Page page = PageUtils.createPage(pageSize, guideCount, pageIndex);
		List<Guide> guides = guideService.listBySerch(guide, page);
		return new ApiResponse(ConstantUtils.RESPONSE_CODE_OK, guides,page);
	}
}
